﻿@model Enum

<div class="sale-setup-label-container">@Html.LabelFor(m => m)</div>
<div class="sale-setup-input-container">
    @Html.DropDownListFor(
        m => m,
        Enum.GetValues(Model.GetType())
            .Cast<Enum>()
            .Select(m =>
            {
                string enumText = Enum.GetName(Model.GetType(), m);
                int enumValue = Convert.ToInt32(m);
                return new SelectListItem()
                {
                    Text = enumText,
                    Value = Convert.ToString(enumValue)
                };
            })
            .OrderBy(m => Convert.ToInt32(m.Value)),
        new Dictionary<string, object> {
            { "data-bind", "value:" + TN_CMS.Framework.Helper.CommonHelper.GetFullHtmlFieldNameWithoutPrefix(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) },
            { "style", "width:auto" }
        }
    )
</div>
<div style="clear:both;height:10px;font-size:0px"></div>